package com.easygem.common.model.system;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.List;

@Data
@Excel("users")
@Table(name = "users") //实体类对应的数据库表

//fasdfsadf
public class User {
    @Id
    @ExcelField(value = "编号", width = 50) //导出字段名
    private Long userId;

    @ExcelField(value = "用户名", width = 100)
    private String userName;

    @ExcelField(value = "昵称", width = 100)
    private String nickName;

    @ExcelField(value = "邮箱", width = 150)
    private String email;

    @ExcelField(value = "电话号码", width = 100)
    private String phone;
//状态 0：未开启外呼，1：已开启外呼，-1：冻结，-2：下线（离职，进入离职分配列表中）
    private Integer status;

    @ExcelField(value = "创建时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss", width = 180)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp createTime;

    @ExcelField(value = "修改时间", dateFormat = "yyyy年MM月dd日 HH:mm:ss",width = 180)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp editTime;

    @ExcelField(value = "密码盐值", width = 100)
    private String salt;

    @ExcelField(//
            value = "用户类型",
            readConverterExp = "超级管理员=0,普通用户=1",
            writeConverterExp = "0=超级管理员,1=普通用户"
            ,width = 80
    )
    private Integer type;

    @ExcelField(value = "用户密码", width = 100)
    private String password;

    private Long deptId;

    @ExcelField(value = "头像url", width = 200)
    private String avatar;
    @TableField(exist = false)
    private transient String departmentName;

    //是否验证 0:未验证，1：已验证
    private Integer isMove;
    //0:超级管理员，1：系统用户
    private Integer isValidate;

    //总部公司账户
    private String accountName;

    //总部公司账户编号
    @ExcelField(value = "座机", width = 200)
    private String telNumber;

    //线路类型ID
    private Long circuitId;

    @TableField(exist = false)
    private transient String roleName;
    @TableField(exist = false)
    private transient List<Long> ids;

    //创建人
    @TableField(exist = false)
    private transient String createUserName;


    //资源数
    @TableField(exist = false)
    private transient Integer resourceCount;

    //客户数
    @TableField(exist = false)
    private transient Integer clientCount;







    //员工id
    private transient Long employeeId;
    //客户编号
    private transient String clientNo;
    //客户编号
    private transient String clientName;
    //角色id
    private transient Long roleId;
    //账户有效期
    private transient String indate;

    //线路类型
    private transient String circuitType;
    //平台类型
    private transient String platformType;
    //账户类型
    private transient String accountType;

    //用作条件 是否只获取管理员
    @TableField(exist = false)
    private transient Boolean isGetAdmin;
}
